font chooser: Use editable api on search entry
authorMatthias Clasen <mclasen@redhat.com>
Sun, 17 Feb 2019 19:48:08 +0000 (14:48 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Tue, 19 Feb 2019 05:25:59 +0000 (00:25 -0500)
gtk/gtkfontchooserwidget.c
gtk/ui/gtkfontchooserwidget.ui

index afe1b922fb0be7d14b6b0a3447dcb8a86cc49538..b378d29a24243f0ddb781e5f76205f6c6c0577f6 100644 (file)
@@ -372,11 +372,11 @@ text_changed_cb (GtkEntry             *entry,
 }
 
 static void
-stop_search_cb (GtkEntry             *entry,
+stop_search_cb (GtkSearchEntry       *entry,
                 GtkFontChooserWidget *fc)
 {
-  if (gtk_entry_get_text (entry)[0] != 0)
-    gtk_entry_set_text (entry, "");
+  if (gtk_editable_get_text (GTK_EDITABLE (entry))[0] != 0)
+    gtk_editable_set_text (GTK_EDITABLE (entry), "");
   else
     {
       GtkWidget *dialog;
@@ -623,7 +623,7 @@ gtk_font_chooser_widget_map (GtkWidget *widget)
   GtkFontChooserWidget *fontchooser = GTK_FONT_CHOOSER_WIDGET (widget);
   GtkFontChooserWidgetPrivate *priv = fontchooser->priv;
 
-  gtk_entry_set_text (GTK_ENTRY (priv->search_entry), "");
+  gtk_editable_set_text (GTK_EDITABLE (priv->search_entry), "");
   gtk_stack_set_visible_child_name (GTK_STACK (priv->stack), "list");
   g_simple_action_set_state (G_SIMPLE_ACTION (priv->tweak_action), g_variant_new_boolean (FALSE));
 
@@ -767,7 +767,7 @@ change_tweak (GSimpleAction *action,
     }
   else
     {
-      gtk_entry_grab_focus_without_selecting (GTK_ENTRY (fontchooser->priv->search_entry));
+      gtk_widget_grab_focus (fontchooser->priv->search_entry);
       gtk_stack_set_visible_child_name (GTK_STACK (fontchooser->priv->stack), "list");
     }
 
@@ -1034,7 +1034,7 @@ visible_func (GtkTreeModel *model,
     }
 
   /* If there's no filter string we show the item */
-  search_text = gtk_entry_get_text (GTK_ENTRY (priv->search_entry));
+  search_text = gtk_editable_get_text (GTK_EDITABLE (priv->search_entry));
   if (strlen (search_text) == 0)
     return TRUE;
 
index 5d06c53cd2fc45433d47466a43be2b0953f18138..25b1f7083a314be6c3e06fe12197189a00c09bcb 100644 (file)
                 <property name="column-spacing">6</property>
                 <child>
                   <object class="GtkSearchEntry" id="search_entry">
-                    <property name="can-focus">1</property>
                     <property name="hexpand">1</property>
                     <property name="activates-default">1</property>
-                    <property name="primary-icon-name">edit-find-symbolic</property>
-                    <property name="primary-icon-activatable">0</property>
-                    <property name="secondary-icon-activatable">0</property>
-                    <property name="primary-icon-sensitive">0</property>
-                    <property name="secondary-icon-sensitive">0</property>
                     <property name="placeholder-text" translatable="yes">Search font name</property>
                     <signal name="search-changed" handler="text_changed_cb" swapped="no"/>
                     <signal name="stop-search" handler="stop_search_cb" swapped="no"/>